import {memberList} from '../../../request/api';
const state = {
    memberlist:[],//会员列表
}

const mutations = {
    CHANGE_MEMBERLIST(state,payload){
        state.memberlist = payload;
    }
}

const actions = {
    // 获取会员列表
    getMemberListAction({commit}){
        memberList().then(res=>{
            console.log(res.list);
            commit('CHANGE_MEMBERLIST',res.list);
        })
    }
}

const getters = {
    getMemberlist(state){
        return state.memberlist
    }
}

export default {
    state, mutations, actions, getters, namespaced: true
}
